﻿using System;

namespace Unis.Framework.Core.Attributes
{
    [AttributeUsage(AttributeTargets.Field | AttributeTargets.Property)]
    public class PropertyXmlConfigAttribute : Attribute
    {

        #region Fields
        private string _mappingName;
        private bool _notExistsGroupNode;
        private Type _referenceModelType;
        private bool _switch;
        #endregion

        #region Properties
        public string MappingName
        {
            get
            {
                return this._mappingName;
            }
            set
            {
                this._mappingName = value;
            }
        }

        public bool NotExistsGroupNode
        {
            get
            {
                return this._notExistsGroupNode;
            }
            set
            {
                this._notExistsGroupNode = value;
            }
        }

        public Type ReferenceModelType
        {
            get
            {
                return this._referenceModelType;
            }
            set
            {
                this._referenceModelType = value;
            }
        }

        public bool Switch
        {
            get
            {
                return this._switch;
            }
            set
            {
                this._switch = false;
            }
        }
        #endregion

        #region Constructs
        public PropertyXmlConfigAttribute()
        {
            _switch = true;
        }

        public PropertyXmlConfigAttribute(Type referenceModelType)
        {
            _switch = true;
            _referenceModelType = referenceModelType;
        }
        #endregion
     
    }
}
